AmazingEA.mq4
(For details regarding changes, see ReadMe Instructions textfile)

Please check the following Thread on Forex Factory for News and Updates:-
http://www.forexfactory.com/showthread.php?t=6854

05-May-2015
Version 5.20 Modified by Alan Prothero
Fixed: EA was modifying orders early when PointsGap or SecBAO is 0
Added: DeleteOnShutdown parameter. If false then orders must be manually removed.

24-Feb-2015
Version 5.10 Modified by Alan Prothero
Money Management Calculation now correctly sets LotSize regardless of Currency or AccountCurrency
Money Management now only works if you use a Stop Loss
Added new TickFile Logging to record Bid, Ask and Spread Data
Open Log Files in Shareable Mode
Fixed PointsGap Issue in MT5 Version

13-Feb-2015
Version 5.00 Modified by Alan Prothero
Published new MT5 Version
Minor changes to MT4 version designed to make the MT4 and MT5 versions similar so they are easier to maintain
Improved Logic for PointsGap and SecBAO - Setting either to 0 disables the PointsGap and SecBAO feature
SlipCheck used to skip the SL/TP Reset when using Break Even and trade was in profit, resulting in reduced TP and Profit due to Slippage
Updated Error Code Translations to include latest MT4 Errors and added MT5 Errors
Improved Logfile Writing to latest standards
Converted Print Commands to Write to Logfile Commands
Version Number Style has changed from N.N.N to N.NN as per MetaTrader standards

27-Mar-2014
Version 4.3.0 Modified by Alan Prothero
Fixed Compile Warnings generated by MT4 updating to Build 625
The warnings were due to not checking return codes from OrderModify, OrderClose or OrderDelete Functions
Errors are now displayed in the AmazingEA LogFile, with expanded descriptions

05-Feb-2014
Version 4.2.0 Modified by Alan Prothero
Fixed 3 Minor Compile Warnings generated by MT4 updating to Build 600
Updated Documentation to reflect Build 600 changes

07-Oct-2013
Version 4.1.0 Modified by Alan Prothero
New Parameter UseBrokerTime can be used to configure EA to use Local PC clock
Add Minimum Stop Level to Orders only if necessary

12-Sep-2013
Version 4.0.0 Modified by Alan Prothero
Revived SlipCheck and Stop Loss Reset Code and MaxSlippage
Changed Head Up Display of 'High' to show Bid Price not Ask, 'Buy Order' is High + Spread + Pointsaway
Ensure ModifyGap can't be set higher than 20

12-Aug-2013
Version 3.2.2 Modified by Alan Prothero
Bugfix: Mistake in V3.2.1 BE Code
Set Minimum StopLevels for Break Even and Trailing
Write Title and Version Number to LogFile

11-Aug-2013
Version 3.2.1 Modified by Alan Prothero
Bugfix: Some OrderModify commands missing Expiration parameter
Refreshed Error Message List

25-Jul-2013
Version 3.2.0 Modified by Alan Prothero
Run Trailing Code before BE Code
New Parameter PointsGap replaces Hard-Coded 10000 Points for Initial Orders
Stopped unnecessary Pending Order Modifications
New Parameter ModifyGap sets the minimum distance in points that price has to change to cause a pending order modification
Reverted the OCO change from 3.1.0
Allow Negative SecBPO/SecBMO again
Changed Risk Code to include Spread - calculation now based on Stop Loss + MaxSpread
Removed Pipe Symbols from Trade Comments

24-Jul-2013
Version 3.1.0 Modified by Alan Prothero
Bugfix: Fixed SL=0 causing Risk Calculation to fail (Div by Zero error)
Changed Risk Code to *Not* Allow Micro Lots because some brokers don't allow them
After STWAN logic changed to keep opposite order as hedge unless OCO=true or both pending orders cancelled due to STWAN
Better Magic Number Definition

28-May-2013
Version 3.0.0 Modified by Alan Prothero
New Setting SecBAO
Default for SecBPO=20 instead of 10
Removed SlipCheck and Stop Loss Reset Code and MaxSlippage
Added Settings: NSec and AllowBuys and AllowSells
Bugfix: EA could open trades between news time and STWAN
Removed Setting CloseTrades (not needed on MT4 Build 500 or higher)
Risk Setting now takes into account SL distance
Added Sleep for 5 seconds when MaxSpread exceeded

27-May-2013
Version 2.4.0 Modified by Alan Prothero
Bugfix: EA could open trades between news time and STWAN
Removed Setting CloseTrades (not needed on MT4 Build 500 or higher)
Risk Setting now takes into account SL distance
Added Sleep for 5 seconds when MaxSpread exceeded

10-May-2013
Version 2.3.0 Modified by Alan Prothero
Allow Negative SecBPO/SecBMO
New Setting TrailImmediate
Minimum Stop Distance now applied to SL and TP as well as Pointsaway

01-May-2013
Version 2.2.1 Modified by Alan Prothero
Bugfix selecting orders to be closed in MT4

25-Apr-2013
Version 2.2.0 Modified by Alan Prothero
New Setting SlipCheck (True/False)
Changed some of the default settings
SL back to 50 instead of 100
SecBPO=10 instead of 20
SecBMO=0 instead of 2
MaxSpread=100

15-Apr-2013
Version 2.1.0 Modified by Alan Prothero
New Setting MaxSlippage
Removed StealthMode

05-Apr-2013
Version 2.0.2 Modified by Alan Prothero
Minor Bug: Break Even or Trail now working even if Hard Stop Loss not used

02-Apr-2013
Version 2.0.1 Modified by Alan Prothero
Minor Bug: Change Stop Loss Reset Code to work even if not using Break-Even

26-Mar-2013 
Version 2.0.0 Modified by Alan Prothero
Fixed Stop Loss Issue from Original Amazing EA 1.1.8 
Fixed Issue with Stop Loss Reset Code introduced in 1.2.3
Adjusted Trade Comment to show CTCBN and OCO settings
New Setting CloseTrades
New Setting MaxSpread
New Setting TrailOffset
New Setting AddSpreadToSL
New Setting StealthMode
Renamed TrailingStop setting to TrailPoints
(See Readme for details of new settings)

01-Mar-2013
Version 1.2.5 Modified by Alan Prothero
Setting NYear, NMonth and Nday all to Zero enables EA every day at NHour:NMin
*WARNING* If you use this and leave the EA running, it will trade at the same time tomorrow *WARNING*
Brokers do not allow Pending Orders to be entered over weekends.

27-Feb-2013
Version 1.2.4 Modified by Alan Prothero
CTCBN now works on any timeframe not just M1. Just pick the timeframe before setting the EA.
Added an automated minimum distance check and adjustment for Pending Orders

22-Feb-2013
Version 1.2.3 Modified by Alan Prothero 
Changed Stop Loss Code to Account for Slippage 
Setting CTCBN to 0 really disables Candle Check now 

15-Dec-2012
Version 1.2.2 Modified by Alan Prothero 
Changed Risk Code to Allow Micro Lots 

03-Dec-2012
Version 1.2.1 Modified by Alan Prothero 
Added NMonth and NYear plus Broker Time Clock 
Renamed Pips to Points Globally 
Added Break Even Offset 

31-Oct-2012
Version 1.2.0 Modified by Alan Prothero 
Added Settings Info in Trade Comments 
Fixed TP=0 disables Take Profit 

04-Oct-2012
Version 1.1.9 Modified by Alan Prothero 
Fixed Break Even Code 
Added Order Delete Function to DeInit Routine 
Improved Help Text and Logging 

Version 1.1.8 Modified by branac, added changeable stop loss 
bbranac@gmail.com 

Version 1.1.7 FiFtHeLeMeNt 
fifthelement80@gmail.com 
